<template>
  <div id="app" :class="obj">
    <router-view />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'App',
  data() {
    return {
      // obj: {
      //   two: true
      // }
    }
  },
  // 基于 vuex中theme颜色选中三个状态, 设置app的类名
  computed: {
    ...mapGetters(['theme']),
    obj() {
      let themeClass = ''
      if (this.theme === '#409EFF') {
        themeClass = 'one'
      }
      if (this.theme === '#1890FF') {
        themeClass = 'two'
      }
      if (this.theme === '#304156') {
        themeClass = 'three'
      }
      return { [themeClass]: true }
    }
  }
}
</script>
